home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 April: Mac OS SDK / Dev.CD Apr 97 SDK1.toast / Development Kits (Disc 1) / Apple Shared Library Manager / ASLM Examples / Example Tools / BuildExample next >
Encoding:
Text File  |  1996-11-19  |  2.4 KB  |  89 lines  |  [TEXT/MPS ]

  1. #
  2. #    File:        BuildExample
  3. #
  4. #    Contains:    Script to build one or more of the examples tools
  5. #
  6. #                BuildExample [-a] [<example>…]
  7. #
  8. #                <example> is the name of the example you want to build without
  9. #                the trailing ".cp". More than one example may be given. For example:
  10. #
  11. #                    BuildExample TMethodNotifierExample TPriorityListExample
  12. #
  13. #                The built tool will be placed in the ":Built" folder.
  14. #
  15. #                If you use the -a options then all tools will be built.
  16. #
  17. #                You must set the SLMInterfaces variable to the location of the folder
  18. #                containing the SLM interface files and the SLMLibraries variable
  19. #                to the location of the folder containing the SLM MPW libraries. You
  20. #                can either set them in this script or set them in the shell and then
  21. #                export them. The default is to look for them on a disk called
  22. #                "Library Manager Developer". 
  23. #
  24. #    Copyright:    © 1993 by Apple Computer, Inc., all rights reserved.
  25. #
  26. #
  27.  
  28. # Set these next two variables to tell MPW where your 
  29. # SLM Interfaces and Libraries are located.
  30.  
  31. If "{SLMInterfaces}" == ""
  32.     set SLMInterfaces    "Library Manager Developer:Interfaces:"
  33. End
  34. If "{SLMLibraries}CFrontLibraries:" == ""
  35.     set SLMLibraries    "Library Manager Developer:Libraries:"
  36. End
  37.  
  38. if NOT `Exists "{SLMInterfaces}"CIncludes:LibraryManager.h`
  39.     Echo '## SLMInterfaces is not set properly!'
  40.     Beep
  41.     Exit 1
  42. end
  43. if NOT `Exists "{SLMLibraries}CFrontLibraries:"LibraryManager.o`
  44.     Echo '## SLMLibraries is not set properly!'
  45.     Beep
  46.     Exit 1
  47. end
  48.  
  49. set SRC    ":Sources:"
  50. set OBJ    ":Objects:"
  51. set BLT    ":Built:"
  52.  
  53. set doAll 0
  54. if "{1}" == "-a"
  55.     set AllTools "`files -o "{SRC}"≈.cp`"
  56.     SHIFT
  57. end
  58.  
  59. for i in {Parameters} {AllTools}
  60.     echo {i}
  61.     if "{AllTools}" == ""
  62.         Break if "{i}" == ""
  63.         set name "{i}"
  64.     else
  65.         continue if NOT ("{i}" =~ /(≈:)«0,1»(≈)®1.cp/)
  66.         set name {®1}
  67.     end
  68.  
  69.     if NOT `Exists "{SRC}{name}".cp`
  70.         Echo "## {name} is not a valid Example!"
  71.         Beep
  72.         Exit 1
  73.     end
  74.     
  75.     echo "#### Building {name}"
  76.     echo "    Compiling ∂"{OBJ}{name}.cp.o∂""
  77.     CPlus "{SRC}{name}".cp -o "{OBJ}{name}".cp.o -i "{SLMInterfaces}CIncludes" -mbg on -model far -sym on,nolines -mf -b2 -opt full -w1 -z15 -z17
  78.     echo "    Linking ∂"{BLT}{name}∂""
  79.     Link -model far -w -d  {LinkOptions} -o "{BLT}{name}" ∂
  80.         -t 'MPST' -c 'MPS ' ∂
  81.         "{CLibraries}CPlusLib.o" ∂
  82.         "{SLMLibraries}CFrontLibraries:LibraryManager.o" ∂
  83.         "{OBJ}{name}".cp.o ∂
  84.         "{Libraries}ToolLibs.o" ∂
  85.         "{Libraries}Runtime.o" ∂
  86.         "{Libraries}Interface.o" ∂
  87.         "{CLibraries}StdCLib.o"
  88. END
  89.